[18.0][ADD] queue_job_is_running#942
Conversation
|
@amh-mw Thank you for your feedback. I will check it. |
c283bf8 to
9bd399f
Compare
|
Update Example Code |
amh-mw
left a comment
There was a problem hiding this comment.
Rename the module to queue_job_is_running or queue_job_banner?
| _name = "queue.job.status.mixin" | ||
| _description = "Queue Job Status Mixin" | ||
|
|
||
| is_job_running = fields.Boolean(compute="_compute_is_job_running") |
There was a problem hiding this comment.
Change Boolean is_job_running field to Char jobs_running to include the name(s) of running job(s)?
| jobs = ( | ||
| self.env["queue.job"] | ||
| .sudo() | ||
| .search_fetch( |
There was a problem hiding this comment.
Instead of search_fetch here, bypass ORM and use PostgreSQL native JSON operators to check for record intersection instead of querying all records for the model? Something like records->'ids' ?| %(self.ids)s? (Pseudo-SQL, certainly wrong.) That might want an index.
99b1049 to
ea273e9
Compare
|
Fixed.
@amh-mw Thank you for your time :) |
This module adds a warning banner and a new boolean field (
is_job_running) to help users understand that a document's status is running. Developers can also hide buttons to prevent users from clicking them and creating duplicate jobs.